package data.financialdata.stub;


import java.util.ArrayList;

import po.AccountPO;
import po.ClientPO;
import po.LikeHashMap;
import po.PayList;
import po.PayPO;
import po.PayPOLineItem;
import po.ReceiveList;
import po.ReceivePO;
import po.ReceivePOLineItem;
import po.UserPO;
import utility.TimePeriod;
import dataservice.financialdataservice.MoneyDataService;

public class MoneyDataServiceSerializableImplStub implements MoneyDataService{
	LikeHashMap<String,PayPO> payList = new LikeHashMap<String,PayPO>();
	ClientPO client = new ClientPO();
	ArrayList<PayPOLineItem> lineItemList = new ArrayList<PayPOLineItem>();
	UserPO user = new UserPO("User1","x007","325400");
	AccountPO account = new AccountPO("Nero",2133);
	ArrayList<ReceivePOLineItem> receiveLineItemList = new ArrayList<ReceivePOLineItem>();

	public boolean addPay(PayPO po) {
		// TODO Auto-generated method stub
		boolean isIn = payList.containsValue(po);
		if(isIn){
			payList.put(po.getSerialNumber().toString(),po);
			System.out.println("add pay receipt successfully");
		}else{
			System.out.println("add pay receipt failed");
		}
		return isIn;
	}

	public boolean addReceive(ReceivePO po) {
		// TODO Auto-generated method stub
		System.out.println("add receive receipt successfully");
		return true;
	}
	
	public PayPO findPay(String id) {
		// TODO Auto-generated method stub
		System.out.println("findPay successfully");
		lineItemList.add(new PayPOLineItem("accountId",1231,"comment"));
		PayList list = new PayList();
		return new PayPO("clientId",list,12312,"userId");
	}


	public ReceivePO findReceive(String id) {
		// TODO Auto-generated method stub
		System.out.println("findReceive successfully");
		receiveLineItemList.add(new ReceivePOLineItem("accountId",1231,"comment"));
		return new ReceivePO("clientId",new ReceiveList(),12312,"userId");
	}

	public ArrayList<PayPO> mutipleConditionFindPay(TimePeriod period,
			ClientPO client, UserPO user) {
		// TODO Auto-generated method stub
		ArrayList<PayPO> list = new ArrayList<PayPO>();
		return list;
	}

	public ArrayList<ReceivePO> mutipleConditionFindReceive(TimePeriod period,
			ClientPO client, UserPO user) {
		// TODO Auto-generated method stub
		ArrayList<ReceivePO> list = new ArrayList<ReceivePO>();
		return list;
	}
	public void init() {
		// TODO Auto-generated method stub
		
	}

	public void finish() {
		// TODO Auto-generated method stub
		
	}
	
}
